#ifndef __IXMLFactoryEnvironment_H__
#define __IXMLFactoryEnvironment_H__
#include <lampe/types.h>
#include <lampe/IReferenceCounted.h>
#include <lampe/xml/IFactoryRecord.h>
#include <lampe/xml/IXmlNode.h>
#include <lampe/xml/TFactorySimpeXML.h>
#include <lampe/stream/IReader.h>
#include <boost/filesystem.hpp>
#include <lampe/io/IFileSystem.h>

namespace lampe{
namespace xml{

class IXMLFactoryEnvironment:public IReferenceCounted{
public:
	typedef boost::function<stream::IReader*(String fileName,IXmlNode*node)> XMLFectoryGetFile;

	virtual void registerHandler(IFactoryRecord*record)=0;
	virtual IFactoryRecord*getFactoryByTagName(String)=0;
	virtual IFactoryRecord*getFactoryByAttributeName(String)=0;

	virtual void removeHandlerFromTag(String name)=0;
	virtual void removeHandlerFromAttribute(String name)=0;
	virtual lampe::xml::TagResult runNode(IXmlNode*node)=0;

	virtual IXmlNode*createXmlTree(boost::filesystem::path fileName)=0;
	virtual IXmlNode*createXmlTree(stream::IReader*fileStream)=0;
	virtual void regSimpeTag(lampe::String element,XMLTagFactoryFunction function)=0;
	virtual void regSimpeAttribute(lampe::String element,XMLAttribyteFactoryFunction function)=0;
	virtual lampe::io::IFileSystem*getFileSystem()=0;
};

IXMLFactoryEnvironment*createXMLFactoryEnvironment(io::IFileSystem*fileSystem);
}//namespace xml
}//namespace lampe
#endif
